{include file='public/meta' }
<title>会员添加 - 木鱼内容管理系统</title>
<style>
  .form1 {
    display: flex;
  }
</style>
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">

  <div class="layui-form-item">
    <label class="layui-form-label">头像上传：</label>
    <div class="layui-input-block">
      <button type="button" class="layui-btn" id="test1">上传图片</button>
      <input class="layui-upload-file" type="file" accept="images" name="file">
      <div class="layui-input-inline" style="float:left;width:45%;">
        <input class="layui-input" type="text" accept="images" id="upico"  name="photo">
      </div>
      <div class="layui-upload-list">
        <img class="layui-upload-img" id="ico1" src="/public/upload/userimages/touxiang.png">
        <p id="demoText"></p>
      </div>
    </div>
  </div>

  <div class="form1">

    <div class="layui-form-item">
      <label class="layui-form-label">会员账号：</label>
      <div class="layui-input-inline">
        <input type="text" name="account" lay-verify="required" placeholder="请输入账号" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">会员昵称：</label>
      <div class="layui-input-inline">
        <input type="text" name="name" lay-verify="required" placeholder="请输入昵称" autocomplete="off" class="layui-input">
      </div>
    </div>

  </div>

  <div class="form1">

    <div class="layui-form-item">
      <label class="layui-form-label">手机号码：</label>
      <div class="layui-input-inline">
        <input type="text" name="phone" lay-verify="phone" placeholder="请输入号码" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">邮箱：</label>
      <div class="layui-input-inline">
        <input type="text" name="email" lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
      </div>
    </div>

  </div>

  <div class="form1">

    <div class="layui-form-item">
      <label class="layui-form-label">会员等级：</label>
      <div class="layui-input-inline">
        <select name="grade">
          <option value=""></option>
          {foreach $mgrade as $gra}
          <option value="{$gra.id}">{$gra.grade}</option>
          {/foreach}
        </select>
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">会员头衔：</label>
      <div class="layui-input-inline">
        <select name="title">
          <option value=""></option>
          {foreach $mtitle as $tit}
          <option value="{$tit.id}">{$tit.name}</option>
          {/foreach}
        </select>
      </div>
    </div>

  </div>

  <div class="layui-form-item" lay-filter="sex">
    <label class="layui-form-label">选择性别：</label>
    <div class="layui-input-block">
      <input type="radio" name="sex" value="1" title="男" checked>
      <input type="radio" name="sex" value="0" title="女">
      <input type="radio" name="sex" value="2" title="保密">
    </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label">介绍：</label>
    <div class="layui-input-inline">
      <textarea placeholder="请输入内容" name="intro" class="layui-textarea"></textarea>
    </div>
  </div>

  <div class="form1">

    <div class="layui-form-item">
      <label class="layui-form-label">初始密码：</label>
      <div class="layui-input-inline">
        <input type="password" name="password" lay-verify="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">确认密码：</label>
      <div class="layui-input-inline">
        <input type="password" name="passwords" lay-verify="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
      </div>
    </div>

  </div>

  <div class="layui-form-item" lay-filter="super">
    <label class="layui-form-label">超级会员：</label>
    <div class="layui-input-block">
      <input type="radio" name="super" value="1" title="是" checked>
      <input type="radio" name="super" value="0" title="否">
    </div>
  </div>

  <div class="layui-form-item" lay-filter="jurisdiction">
    <label class="layui-form-label">投稿权限：</label>
    <div class="layui-input-block">
      <input type="radio" name="jurisdiction" value="1" title="直接发布" checked>
      <input type="radio" name="jurisdiction" value="0" title="需要审核">
    </div>
  </div>

  <div class="layui-form-item layui-hide">
    <button type="button" lay-submit lay-filter="muyu-ajax-submit" id="muyu-ajax-submit">提交</button>
  </div>
</div>

{include file='public/footer' }
<style type="text/css" media="all">
  /*上传头像样式开始*/
  .layui-upload-img{width: 92px; height: 92px; margin: 0 10px 10px 0;}
  /*上传头像样式结束*/
</style>
<script>
  layui.config({
    base: '__ADMINST__layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'upload'], function(){
    var $ = layui.$
            ,form = layui.form ;
  })

  //图片上传
  layui.use('upload', function(){
    var $ = layui.jquery
            ,upload = layui.upload;

    //普通图片上传
    var uploadInst = upload.render({
      elem: '#test1'
      ,url: "{:url('Base/imgupload')}" //改成您自己的上传接口
      ,data:{upurl:'/public/upload/userimages'}
      ,done: function(res){
        //如果上传失败
        if(res.code == 1){
          $('#ico1').attr('src', res.photo);
          $("#upico").val(res.photo);
          return layer.msg('上传成功');
        }else{
          return layer.msg('上传失败');
        }

      }
      ,error: function(){

      }
    });
  });



</script>
</body>
</html>